<template>
  <el-config-provider :locale="appStore.elLocale">
    <yv-config-provider :locale="appStore.yvLocale" @changeLocale="changeLocale">
      <router-view/>
    </yv-config-provider>
  </el-config-provider>
</template>
<script lang="ts">
import {onMounted, reactive} from "vue";
import {ElConfigProvider} from 'element-plus'
import useAppStore from "./store/useAppStore"

export default {
  data() {
    const appStore = useAppStore()
    return {
      appStore
    }
  },
  methods: {
    /**
     * Studio 中请求切换语言
     */
    changeLocale(language) {
      this.appStore.changeLanguage(language)
    }
  }
}
</script>